/*
 * @Author: zhuwenzhi
 * @Date: 2024-06-19 22:43:13
 * @LastEditTime: 2024-06-19 22:44:26
 * @LastEditors: zhuwenzhi
 * @FilePath: /dva-quickstart/src/services/users.js
 * @Description:
 */
import request from "../utils/request";
import { PAGE_SIZE } from "../../constants";

export function fetch({ page }) {
  return request(`/api/users?_page=${page}&_limit=${PAGE_SIZE}`);
}

export function remove(id) {
  return request(`/api/users/${id}`, {
    method: "DELETE",
  });
}

export function patch(id, values) {
  return request(`/api/users/${id}`, {
    method: "PATCH",
    body: JSON.stringify(values),
  });
}

export function create(values) {
  return request("/api/users/create", {
    method: "POST",
    body: JSON.stringify(values),
  });
}
